package com.sgs.carbon.web.modules.common.mq.producer.dict;

import com.sgs.carbon.starter.mq.core.util.RedisMessageUtils;
import com.sgs.carbon.web.modules.common.mq.message.dict.SysDictDataRefreshMessage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;

/**
 * DictData 字典数据相关消息的 Producer
 *
 * @author Dave Liu
 * @date 2021-10-07
 */
@Component
public class SysDictDataProducer {

    @Autowired
    private StringRedisTemplate stringRedisTemplate;

    /**
     * 发送 {@link SysDictDataRefreshMessage} 消息
     */
    public void sendDictDataRefreshMessage() {
        SysDictDataRefreshMessage message = new SysDictDataRefreshMessage();
        RedisMessageUtils.sendChannelMessage(stringRedisTemplate, message);
    }

}
